﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QueryData;

public class 拆分查询
{
    void MyMethod()
    {
        using (var db = new BasicDbContext())
        {
            (from x in db.MainEntities.AsSplitQuery().Include(m => m.SubEntities) select x).ToList();
            (from x in db.MainEntities.AsSingleQuery().Include(m => m.SubEntities) select x).ToList();
        }
    }
}
